#include "closetabdialog.h"
#include "ui_closetabdialog.h"

closetabdialog::closetabdialog(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::closetabdialog)
{
    m_ui->setupUi(this);
    this->setVisible(false);

    connect(m_ui->buttonBox, SIGNAL(accepted()),this,SLOT(onAccept()));
    connect(m_ui->buttonBox, SIGNAL(rejected()),this,SLOT(onReject()));
}

closetabdialog::~closetabdialog()
{
    delete m_ui;
}

void closetabdialog::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void closetabdialog::onAccept()
{
    //Comunico la volontà di salvare il file
    emit pubOk();
}

void closetabdialog::onReject()
{
    //Comunico la volontà di scartare le modifiche al file
    emit pubCancel();
}

void closetabdialog::setMessage(QString message)
{
    m_ui->lblMessage->setText(message);
}
